﻿<UserControl
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:controls="clr-namespace:Rabbit.Controls;assembly=Rabbit.Controls"
            x:Class="MicroBlogClient.UCPublishStatus"
             mc:Ignorable="d" 
             d:DesignHeight="100" d:DesignWidth="300">
    <StackPanel> 
            <Grid>
                <controls:RichTextBoxEx x:Name="rtbStatus" AutoAddWhiteSpaceAfterTriggered="True"
                                        PreviewKeyDown="rtbStatus_PreviewKeyDown"  
                                        Template="{DynamicResource RichTextBoxTemplate}" 
                                        ScrollViewer.VerticalScrollBarVisibility="Auto" 
                                        InfoText="{StaticResource StatusTextBoxHintText}" />

                <Button Style="{DynamicResource WindowTitleBarButtonStyle}" IsEnabled="{Binding IsEnabled,ElementName=btnPublish}" Visibility="{Binding HasContent,ElementName=rtbStatus,Converter={StaticResource BooleanToVisibilityConverter}}"
                        ToolTip="清除内容" Height="21" Padding="0,-2,0,0"  x:Name="btnClearStatus" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,6,15,0" Click="btnClearStatus_Click">
                    <TextBlock Text="X"/>
                </Button>
                <TextBlock VerticalAlignment="Center"
                           Visibility="{Binding Visibility,ElementName=btnClearStatus}"
                           HorizontalAlignment="Center" 
                           Opacity="0.3"  FontSize="15"
                           Text="Esc键可取消发表"/>
            </Grid> 
        <Grid    VerticalAlignment="Center"  Background="{x:Null}">
            <Menu Margin="10,0,0,0">
                <MenuItem Header="表情"  ToolTip="表情" Style="{DynamicResource SimpleMenuItemStyle}" x:Name="miEmotions" Click="miEmotions_Click"/>
                <MenuItem Header="图片"  Style="{DynamicResource SimpleMenuItemStyle}"  x:Name="miPicture" Click="miPicture_Click">
                    <MenuItem.ToolTip>
                        <TextBlock TextWrapping="Wrap" Width="200"> 单击可以选择图片,或者将图片直接拖到上面的文本框中,也可以将剪贴板中的图片直接粘贴到上面的文本框中
                        </TextBlock>
                    </MenuItem.ToolTip>
                </MenuItem>
                <MenuItem Header="话题"  ToolTip="话题" Style="{DynamicResource SimpleMenuItemStyle}" x:Name="miTopic"  Click="miTopic_Click"/>
                <MenuItem Header="截屏" ToolTip="按住Ctrl单击截屏时,会自动隐藏当前窗口"  x:Name="miCaptureScreen" Style="{DynamicResource SimpleMenuItemStyle}" Click="miCaptureScreen_Click">
                    <!--<MenuItem Header="截屏时隐藏" IsCheckable="True"  x:Name="miHideMeWhenCapture" Style="{DynamicResource SimpleMenuItemStyle}"/>-->
                </MenuItem>
                <MenuItem Header="反馈" Style="{DynamicResource SimpleMenuItemStyle}"  Click="miFeedback_Click">
                    <!--<MenuItem Header="反馈"  x:Name="miFeedback" Style="{DynamicResource SimpleMenuItemStyle}" Click="miFeedback_Click"/>
                    <MenuItem Header="粉作者"   x:Name="miAddAuthorAsFriend" Style="{DynamicResource SimpleMenuItemStyle}" Click="miAddAuthorAsFriend_Click"/>-->
                    <!--<MenuItem Header="涂鸦"   x:Name="miPaint" Style="{DynamicResource SimpleMenuItemStyle}" Click="miPaint_Click"/>-->
                </MenuItem>
            </Menu>
            <Button   HorizontalAlignment="Right" Margin="0,0,5,0"
                                x:Name="btnPublish" 
                                Style="{DynamicResource PublishButtonStyle}"
                                Click="btnPublishStatus_Click" Content="发  表" />
            <!--IsEnabled="{Binding Text.Length,ElementName=txtStatus,Converter={StaticResource LessThanOrEqualConverter},ConverterParameter=0}"-->
            <Popup x:Name="popupEmotions" StaysOpen="False" PlacementTarget="{Binding ElementName=miEmotions}" Placement="Top" AllowsTransparency="True" >
                <Border Style="{DynamicResource EmotionListBorderStyle}" >
                    <TabControl x:Name="tcEmotions" TabStripPlacement="Top" Background="White"/>
                </Border>
            </Popup>
        </Grid>
    </StackPanel>
</UserControl>
